package com.mediastory.spsserver.adFile.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.mediastory.spsserver.adFile.dao.AdFileDao;
import com.mediastory.spsserver.adFile.domain.AdFile;
import com.mediastory.spsserver.adFile.service.AdFileSvc;

@Service
@Transactional
public class AdFileSvcImpl implements AdFileSvc {
	
	@Autowired
	AdFileDao adFileDao;

	public AdFileSvcImpl() {
		// TODO Auto-generated constructor stub
	}

	@Override
	public List<AdFile> findbyList(Map<String, Object> condition)
			throws Exception {
		// TODO Auto-generated method stub
		return (List<AdFile>) (adFileDao.SelectList(condition));
	}

	public Map<String, Object> findbyListPaging(Map<String, Object> condition)
			throws Exception {
		// TODO Auto-generated method stub
		Map<String, Object> resultMap = new HashMap<String, Object>();
		resultMap.put("contentList", (List<AdFile>) (adFileDao.SelectList(condition)));
		resultMap.put("contentListTotalCnt", (Integer) (adFileDao.SelectListTotalCnt(condition)));
		
		return resultMap;
	}

	@Override
	public AdFile findby(Map<String, Object> condition) throws Exception {
		// TODO Auto-generated method stub
		return adFileDao.select(condition);
	}

	@Override
	public AdFile add(AdFile adFile) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public AdFile modify(AdFile adFile) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int remove(Map<String, Object> condition) throws Exception {
		// TODO Auto-generated method stub
		return adFileDao.delete(condition);
	}

}
